import React from 'react';
import { Router, Route, Switch } from 'dva/router';
import MainLayout from './routes/mainLayout';
import DataScan from './routes/dataLuo/dataScan';
import DataLook from './routes/dataLuo/dataLook';
import DataControl from './routes/dataLuo/dataControl';

import { LocaleProvider } from 'antd';
import zh_CN from 'antd/lib/locale-provider/zh_CN';
import moment from 'moment';
import 'moment/locale/zh-cn';

moment.locale('zh-cn');

function RouterConfig({ history }) {
  return (
    <LocaleProvider locale={zh_CN}>
    <Router history={history}>
      {/* <Switch>
        <Route path="/" exact component={mainLayout} />
      </Switch> */}
        <Route
          render={() => (<MainLayout>
            <Switch>
              <Route
                component={DataScan}
                exact
                path="/dataScan"
              />
              <Route
                component={DataLook}
                exact
                path="/dataLook"
              />
               <Route
                component={DataControl}
                exact
                path="/dataControl"
              />
              
            </Switch>
          </MainLayout>)}
        />
    </Router>
    </LocaleProvider>
  );
}

export default RouterConfig;
